declare
sumofparams number:=0;

begin

update FSI_CONTROL_ASSESSMENT_ADMIN set n_default_weight ='30' where v_param_name='D_DQ_WARNING';
update FSI_CONTROL_ASSESSMENT_ADMIN set n_default_weight ='25' where v_param_name='D_DQ_DEFAULT';
update FSI_CONTROL_ASSESSMENT_ADMIN set n_default_weight ='25' where v_param_name='D_DQ_INFO';
update FSI_CONTROL_ASSESSMENT_ADMIN set n_default_weight ='20' where v_param_name='D_DQ_ERROR';

select sum(n_default_weight) into sumofparams from FSI_CONTROL_ASSESSMENT_ADMIN where v_param_name in('D_DQ_WARNING','D_DQ_DEFAULT','D_DQ_INFO','D_DQ_ERROR');

if(sumofparams>100) then
raise_application_error(-20001,'Weight value should not be less than 0 or greater than 100');
rollback;
else
commit;
end if;
end;
/

declare
sumofparams number:=0;

begin

update FSI_CONTROL_USER_PARAMS_RANGE set V_START_WITH ='2000000' where V_PARAM_NAME='D_FAILED_AMOUNT_THRESHOLD';
update FSI_CONTROL_USER_PARAMS_RANGE set V_START_WITH ='20' where V_PARAM_NAME='D_PERCENTAGE_FAILED_TRANSACTION_COUNT';

select sum(V_START_WITH) into sumofparams from FSI_CONTROL_USER_PARAMS_RANGE where v_param_name in('D_PERCENTAGE_FAILED_TRANSACTION_COUNT');

if(sumofparams>100) then
raise_application_error(-20001,'Weight value should not be less than 0 or greater than 100');
rollback;
else
commit;
end if;
end;
/

	

